import numpy as np

if __name__ == '__main__':
  persontype = np.dtype({
    'names': ['name', 'chinese', 'english', 'math', 'total'],
    'formats': ['S32', 'i', 'i', 'i', 'i']
  })
  peoples = np.array(
      [
        ("zhangfei", 66, 65, 30, 0),
        ("guanyu", 95, 85, 98, 0),
        ("zhaoyun", 93, 92, 96, 0),
        ("huangzhong", 90, 88, 77, 0),
        ("dianwei", 80, 90, 90, 0),
      ],
      dtype=persontype
  )
  chinese = peoples[:]['chinese']
  english = peoples[:]['english']
  math = peoples[:]['math']
  print("平均成绩如下：")
  print("语文", np.mean(chinese))
  print("英语", np.mean(english))
  print("数学", np.mean(math))
  print("最小成绩如下：")
  print("语文", np.min(chinese))
  print("英语", np.min(english))
  print("数学", np.min(math))
  print("最大成绩如下：")
  print("语文", np.max(chinese))
  print("英语", np.max(english))
  print("数学", np.max(math))
  print("方差如下：")
  print("语文", np.var(chinese))
  print("英语", np.var(english))
  print("数学", np.var(math))
  print("标准差如下：")
  print("语文", np.std(chinese))
  print("英语", np.std(english))
  print("数学", np.std(math))
